TEMPLATE = lib
CONFIG += plugin

TARGET = minidlnaplugin
PIODIR = ../bin
DESTDIR = ../bin/plugins

INCLUDEPATH += ../include

THIRDPARTY += $${PWD}/../thirdparty/bin/minidlna
THIRDPARTY += $${PWD}/../thirdparty/minidlna.conf
win32 {
    THIRDPARTY ~= s,/,\\,g
    DESTDIR_WIN = $${PIODIR}
    DESTDIR_WIN ~= s,/,\\,g
    for(FILE,THIRDPARTY){
        QMAKE_POST_LINK += $$quote(cmd /c copy /y $${FILE} $${DESTDIR_WIN}$$escape_expand(\\n\\t))
    }
}
unix {
    for(FILE,THIRDPARTY){
        QMAKE_POST_LINK += $$quote(pwd$$escape_expand(\\n\\t))
        QMAKE_POST_LINK += $$quote(cp $${FILE} $${PIODIR}$$escape_expand(\\n\\t))
    }
}

HEADERS += \
    minidlnaplugin.h

SOURCES += \
    minidlnaplugin.cpp

TRANSLATIONS += libminidlnaplugin-de_DE.ts

!isEmpty(TRANSLATIONS) {
    isEmpty(QMAKE_LRELEASE) {
        win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
        else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
    }
    isEmpty(TS_DIR):TS_DIR = translations
    TSQM.name = lrelease ${QMAKE_FILE_IN}
    TSQM.input = TRANSLATIONS
    TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
    TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$PIODIR/${QMAKE_FILE_BASE}.qm
    TSQM.CONFIG = no_link
    QMAKE_EXTRA_COMPILERS += TSQM
    PRE_TARGETDEPS += compiler_TSQM_make_all
} else:message(No translation files in project)
